package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CourseLessonMapper;
import com.ruoyi.system.domain.CourseLesson;
import com.ruoyi.system.service.ICourseLessonService;

/**
 * 课程节内容Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-20
 */
@Service
public class CourseLessonServiceImpl implements ICourseLessonService 
{
    @Autowired
    private CourseLessonMapper courseLessonMapper;

    /**
     * 查询课程节内容
     * 
     * @param id 课程节内容主键
     * @return 课程节内容
     */
    @Override
    public CourseLesson selectCourseLessonById(Long id)
    {
        return courseLessonMapper.selectCourseLessonById(id);
    }

    /**
     * 查询课程节内容列表
     * 
     * @param courseLesson 课程节内容
     * @return 课程节内容
     */
    @Override
    public List<CourseLesson> selectCourseLessonList(CourseLesson courseLesson)
    {
        return courseLessonMapper.selectCourseLessonList(courseLesson);
    }

    /**
     * 新增课程节内容
     * 
     * @param courseLesson 课程节内容
     * @return 结果
     */
    @Override
    public int insertCourseLesson(CourseLesson courseLesson)
    {
        courseLesson.setCreateTime(DateUtils.getNowDate());
        return courseLessonMapper.insertCourseLesson(courseLesson);
    }

    /**
     * 修改课程节内容
     * 
     * @param courseLesson 课程节内容
     * @return 结果
     */
    @Override
    public int updateCourseLesson(CourseLesson courseLesson)
    {
        courseLesson.setUpdateTime(DateUtils.getNowDate());
        return courseLessonMapper.updateCourseLesson(courseLesson);
    }

    /**
     * 批量删除课程节内容
     * 
     * @param ids 需要删除的课程节内容主键
     * @return 结果
     */
    @Override
    public int deleteCourseLessonByIds(Long[] ids)
    {
        return courseLessonMapper.deleteCourseLessonByIds(ids);
    }

    /**
     * 删除课程节内容信息
     * 
     * @param id 课程节内容主键
     * @return 结果
     */
    @Override
    public int deleteCourseLessonById(Long id)
    {
        return courseLessonMapper.deleteCourseLessonById(id);
    }
}
